package com.example.lanouhn.firstapp.activity.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * 创建适配器，来绑定封装好的数据到
 * Created by lanouhn on 16/7/22.
 */
public class GoodsDetailPagerAdapter extends FragmentStatePagerAdapter{

    //定义集合  传递标签名称
    private List<String> list;
    private List<Fragment> fraList;

    public GoodsDetailPagerAdapter(FragmentManager fm, List<String> list, List<Fragment> fraList) {
        super(fm);
        this.list = list;
        this.fraList = fraList;
    }

    @Override
    public Fragment getItem(int position) {
        return fraList.get(position);
    }

    @Override
    public int getCount() {
        return fraList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return list.get(position);
    }
}
